import { makeObservable, observable, action } from 'mobx'
class AppleItemStore {

  id = 0
  weight = 0
  eated = false

  constructor (id) {
    this.id = id + 1
    this.weight = Math.floor(200 + Math.random() * 5)
    makeObservable(this, {
      eated: observable,
      eatApple: action.bound
    })
  }

  eatApple () {
    this.eated = !this.eated
  }
}

export default AppleItemStore